/**
  @file     	DESIGNPATTERN_Decorator.cpp 
  @brief    	1.When the algorithm to create complex object should be independent of the part of the object, 
                  as well as their assembly;
				2.When construction process must be allowed to construct the object is different;
  @author  	arvin
  @version 	1.0   2012/12/20
 */

#include "stdafx.h"

#ifndef CXX_DESIGNPATTERN_DECORATOR_H
#include "DESIGNPATTERN_Decorator.h"
#endif

/**
* Construction
*
* @param VOID
* @return
*/
Decorator::Decorator(MANUFACTURER_TYPE eManufacturer, ComputerComponent* pComputerComponent) :
	ComputerComponent(COMPUTER_NONE),
	m_eManufacturer(eManufacturer),
	m_pComputerComponent(pComputerComponent)
{
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
}

/**
* Destruction
*
* @param VOID
* @return
*/
Decorator::~Decorator()
{
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
}

/**
* Operation
*
* @param VOID
* @return VOID
*/
VOID 
Decorator::Operation()
{
	ComputerComponent::Operation();
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	m_pComputerComponent->Operation();
}

/**
* SetComputer
*
* @param MANUFACTURER_TYPE eManufacturer
* @return
*/
VOID 
Decorator::SetManufacturer(MANUFACTURER_TYPE eManufacturer)
{
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	m_eManufacturer = eManufacturer;
}

/**
* GetComputer
*
* @param VOID
* @return
*/
MANUFACTURER_TYPE 
Decorator::GetManufacturer()
{
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	return m_eManufacturer;
}

/**
* Construction
*
* @param ComputerComponent* pComputerComponent
* @return
*/
ASUSDecorator::ASUSDecorator(ComputerComponent* pComputerComponent) :
	Decorator(MANUFACTURER_ASUS, pComputerComponent)
{
	DEBUG_PRINTF("");
}

/**
* Destruction
*
* @param VOID
* @return
*/
ASUSDecorator::~ASUSDecorator()
{
	DEBUG_PRINTF("");
}

/**
* Operation
*
* @param VOID
* @return VOID
*/
VOID 
ASUSDecorator::Operation()
{
	DEBUG_PRINTF("");
	Decorator::Operation();
	AddedBehavior();
}

/**
* AddedBehavior
*
* @param VOID
* @return VOID
*/
VOID 
ASUSDecorator::AddedBehavior()
{
	DEBUG_PRINTF("");
}


/**
* Construction
*
* @param ComputerComponent* pComputerComponent
* @return
*/
DELLDecorator::DELLDecorator(ComputerComponent* pComputerComponent) :
	Decorator(MANUFACTURER_DELL, pComputerComponent)
{
	DEBUG_PRINTF("");
}

/**
* Destruction
*
* @param VOID
* @return
*/
DELLDecorator::~DELLDecorator()
{
	DEBUG_PRINTF("");
}

/**
* Operation
*
* @param VOID
* @return VOID
*/
VOID
DELLDecorator::Operation()
{
	DEBUG_PRINTF("");
	Decorator::Operation();
	AddedBehavior();
}

/**
* AddedBehavior
*
* @param VOID
* @return VOID
*/
VOID
DELLDecorator::AddedBehavior()
{
	DEBUG_PRINTF("");
}

/**
* Construction
*
* @param ComputerComponent* pComputerComponent
* @return
*/
HPDecorator::HPDecorator(ComputerComponent* pComputerComponent) :
	Decorator(MANUFACTURER_HP, pComputerComponent)
{
	DEBUG_PRINTF("");
}

/**
* Destruction
*
* @param VOID
* @return
*/
HPDecorator::~HPDecorator()
{
	DEBUG_PRINTF("");
}

/**
* Operation
*
* @param VOID
* @return VOID
*/
VOID
HPDecorator::Operation()
{
	DEBUG_PRINTF("");
	Decorator::Operation();
	AddedBehavior();
}

/**
* AddedBehavior
*
* @param VOID
* @return VOID
*/
VOID
HPDecorator::AddedBehavior()
{
	DEBUG_PRINTF("");
}
/* EOF */